package util;

import pojo.User;

import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.UUID;

public class CommonsUtils {

    //生成uuid
    public static String getUUID() {
        return UUID.randomUUID().toString();
    }

    public static Integer getUserId(HttpSession session){
        List<User> u = (List<User>) session.getAttribute("userList");
        User uu = u.get(0);
        return uu.getUid();
    }
}
